pg_dump restore as transaction? - Mailing list pgsql-general

From Owen Hartnett
Subject pg_dump restore as transaction?
Date
Msg-id p0624080ec559cdec47b2@[192.168.0.107]
Whole thread Raw
In response to Re: Detecting changes to certain fields in 'before update' trigger functions  ("Richard Broersma" <richard.broersma@gmail.com>)
Responses Re: pg_dump restore as transaction?
Re: pg_dump restore as transaction?
Re: pg_dump restore as transaction?
List pgsql-general
If my perusal of the sql generated by pg_dump is correct, then it
doesn't appear that it's wrapped in a transaction, and thus might be
able to only complete a partial restore?

Or does

psql myDatabase <mypg_dumpfile

wrap the file stream in a transaction?

If not, is there a reason why it can't be done so (some process that
cannot be run as a transaction inside the file)?

Or should I just add begin and commit statements at the beginning and
end of file?

I want to provide a mechanized daily update of one schema into a
differently named database, and I'd like it to rollback if if fails.

-Owen

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Detecting changes to certain fields in 'before update' trigger functions
Next
From: Tom Lane
Date:
Subject: Re: pg_dump restore as transaction?